Skip to content

Subsequent VM Creation is failing for ISCSI Storage Pool on Oracle Linux - #88

Open
suryag1201 wants to merge 3 commits into
mainfrom
bugfix/CSTACKEX-233
Open

Subsequent VM Creation is failing for ISCSI Storage Pool on Oracle Linux#88
suryag1201 wants to merge 3 commits into
mainfrom
bugfix/CSTACKEX-233

Conversation

@suryag1201

@suryag1201 suryag1201 commented Aug 7, 2026

Copy link
Copy Markdown

Description

Subsequent VM Creation is failing for ISCSI Storage Pool on Oracle Linux

Types of changes

  • Breaking change (fix or feature that would cause existing functionality to change)
  • New feature (non-breaking change which adds functionality)
  • Bug fix (non-breaking change which fixes an issue)
  • Enhancement (improves an existing feature and functionality)
  • Cleanup (Code refactoring and cleanup, that may add test cases)
  • Build/CI
  • Test (unit or integration test code)

Feature/Enhancement Scale or Bug Severity

Feature/Enhancement Scale

  • Major
  • Minor

Bug Severity

  • BLOCKER
  • Critical
  • Major
  • Minor
  • Trivial

Screenshots (if appropriate):

How Has This Been Tested?

Tested on both Oracle and Unbuntu and tried creating multiple VMs

How did you try to break this feature and the system with this change?

Copilot AI lite review requested due to automatic review settings August 7, 2026 10:46

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR addresses failures when creating subsequent VMs on iSCSI primary storage with KVM (notably on Oracle Linux) by making iSCSI login/rescan behavior more robust and adding additional readiness checks before proceeding.

Changes:

  • Adds explicit handling for iscsiadm exit codes and a pre-login session existence check to decide when a rescan is needed.
  • Updates iSCSI login result handling to be idempotent across distros (Ubuntu vs Oracle Linux behavior) and triggers rescans when a session pre-exists.
  • Adds extra validation for device readiness and improves by-path filesystem checks before calling blockdev.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Copilot AI review requested due to automatic review settings August 11, 2026 18:46

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 1 out of 1 changed files in this pull request and generated no new comments.

Suppressed comments (2)

plugins/hypervisors/kvm/src/main/java/com/cloud/hypervisor/kvm/storage/IscsiAdmStorageAdaptor.java:177

  • The warning uses volumeUuid as the “target” identifier, but the log message is about the iSCSI target/portal; this can be misleading when troubleshooting. Use the computed IQN (iqn) in the message (and optionally include the volume path separately).
        if (getPhysicalDisk(volumeUuid, pool).getSize() <= 0) {
            logger.warn("iSCSI device not ready for target {} at {}:{} after wait", volumeUuid, host, port);
            return false;

plugins/hypervisors/kvm/src/main/java/com/cloud/hypervisor/kvm/storage/IscsiAdmStorageAdaptor.java:366

  • Files.isRegularFile(devicePath) follows symlinks by default, so a by-path symlink that (incorrectly) points to a regular file will be reported as a “regular file at by-path”, and the subsequent isSymbolicLink check becomes unreachable in that case. Check isSymbolicLink first, or use NOFOLLOW_LINKS to test the path itself.
            if (Files.isRegularFile(devicePath)) {
                logger.warn("Found a corrupt regular file at iSCSI by-path {} (expected block device symlink); it must be removed manually", deviceByPath);
                return 0L;
            }
            if (!Files.isSymbolicLink(devicePath)) {

@github-actions

Copy link
Copy Markdown

🔴 Test Coverage Grade: D — Marginal

Metric Value
Line coverage 24.58%
Branch coverage 18.75%

Grade Scale

Grade Line Coverage Meaning
🟢 A ≥ 80% Excellent - this code sleeps well at night 😴
🟡 B 60-79% Good - almost there, don't stop now 😉
🟠 C 40-59% Acceptable - your code is wearing a seatbelt, but no airbags 😬
🔴 D 20-39% Marginal - boldly shipping where no test has gone before 🖖
⛔ F < 20% Failing - tests? what tests? 🔥

Branch coverage is shown as a secondary signal. Grade is determined by line coverage.
View full Actions run

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants